'''
向测试网站发送请求
http://httpbin.org/get

请求的包装
'''
import requests
url="http://httpbin.org/get"

#请求头 可上网搜索user-agent大全，避免重复使用同一个user-agent
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
}

html= requests.get(url=url,headers=headers).text
print(html)#不请求头的话，打印内容"User-Agent": "python-requests/2.26.0"